package Eyjafjalla.action;

import Eyjafjalla.patch.CloudPatch;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;

public class RetainCloudAction extends AbstractGameAction {
    public RetainCloudAction(AbstractCard c){
        this.c = c;
        this.actionType = ActionType.CARD_MANIPULATION;
    }

    @Override
    public void update() {
        //云层已满或已在云层则不执行
        if(AbstractDungeon.player.exhaustPile.contains(c)||CloudPatch.cloudGroup.size()>=5|| CloudPatch.cloudGroup.contains(c))
        {
            this.isDone =true;
            return;
        }
        AbstractDungeon.player.hand.removeCard(c);
        CloudPatch.addToTop(c);
        CloudPatch.refreshCloudLayout();
        this.isDone = true;
    }

    AbstractCard c;
}
